﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Common.ControlDevice
{
    /**
     * \brief 生成杂项设备列表
     */
    public class SelectedDevice : INotifyPropertyChanged
    {
        public SelectedDevice()
        { }
        // 集中站ID
        public uint ID = 0;
        // 设备名称
        private string deviceName = string.Empty;
        public string DeviceName
        {
            get { return deviceName; }
            set
            {
                deviceName = value;
                OnNotifyPropertyChanged("DeivceName");
            }
        }
        // 设备是否生成
        private bool isGenerate = true;
        public bool IsGenerate
        {
            get { return isGenerate; }
            set
            {
                isGenerate = value;
                OnNotifyPropertyChanged("IsGenerate");
            }
        }

        // 设备个数
        private int deviceNum = 0;
        public int DeviceNum
        {
            get
            {
                return deviceNum;
            }
            set
            {
                deviceNum = value;
                if (null != PropertyChanged)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("DeviceNum"));
                }
            }
        }
        // 文件路径
        private string filePath = string.Empty;
        public string FilePath
        {
            get
            {
                return filePath;
            }
            set
            {
                filePath = value;
                if (null != PropertyChanged)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("FilePath"));
                }
            }
        }
        // 文件版本
        private string fileVersion= string.Empty;
        public string FileVersion
        {
            get
            {
                return fileVersion;
            }
            set
            {
                fileVersion = value;
                if (null != PropertyChanged)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("FileVersion"));
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnNotifyPropertyChanged(string propertyName)
        {
            if (null != PropertyChanged)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    /**
     * \brief 集中站
     */
    public class ComStation : INotifyPropertyChanged
    {
        public ComStation()
        { }
        // 集中站ID
        public uint StationID = 0;

        private string station = string.Empty;
        // 集中站名称
        public string Station
        {
            get { return station; }
            set
            {
                station = value;
                OnNotifyPropertyChanged("Station");
            }
        }
        // 是否选中
        private bool isGenerate = true;
        public bool IsGenerate
        {
            get { return isGenerate; }
            set
            {
                isGenerate = value;
                OnNotifyPropertyChanged("IsGenerate");
            }
        }
        // 文件路径
        private string filePath = string.Empty;
        public string FilePath
        {
            get
            {
                return filePath;
            }
            set
            {
                filePath = value;
                if (null != PropertyChanged)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("FilePath"));
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnNotifyPropertyChanged(string propertyName)
        {
            if (null != PropertyChanged)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
